package org.chispa.api.query;

import org.chispa.api.processor.ProcessorFactory;

public class QueryWrapperFactory {

	private QueryWrapperFactory(){};
	private static QueryWrapperFactory instance=new QueryWrapperFactory();
	public static QueryWrapperFactory getInstance(){return instance;}

	public <T> QueryWrapper<String,Long> createWrapperFromString(T param)
	{
		String query=param.toString();
		String upper=query.toUpperCase();
		if(upper.contains("SELECT")|| upper.contains("ASK")||
				upper.contains("CONSTRUCT")|| upper.contains("DESCRIBE")||
				upper.contains("INSERT")||upper.contains("MODIFY")||upper.contains("DELETE"))
			return new QuerySparqlWrapper(query,ProcessorFactory.getInstance().getProcessor(query,String.class));
		return null;

	}

}
